Skip to content

Conversation

@davidkyle
Copy link
Member

When creating an inference endpoint with the Elasticsearch service the deployment_id service setting can be used connect to an existing ml trained model deployment. A bug was found where inference on an endpoint created this way would fail with the error Could not find trained model [X]. The problem was that the deployment_id setting was lost when updating the service settings with the text embedding dimensions.

The bug only applied to Text Embedding models uploaded with the Eland eland_import_hub_model script.

The bug could be easily reproduced with these steps:

# Upload a model from HuggingFace
docker run -it --rm docker.elastic.co/eland/eland \
    eland_import_hub_model \
      --url 'http://host.docker.internal:9200' \
      --hub-model-id intfloat/multilingual-e5-small \
      --task-type text_embedding \
      --insecure 

# Deploy that model
POST _ml/trained_models/intfloat__multilingual-e5-small/deployment/_start

# Create an inference endpoint referencing the deployment
PUT _inference/text_embedding/hf
{
  "service": "elasticsearch",
  "service_settings": {
    "deployment_id": "intfloat__multilingual-e5-small" 
  }
}

# Inference fails with resource not found
POST /_inference/text_embedding/hf
{
  "input": "The sky above the port was the color of television tuned to a dead channel.",
  "task_settings": {
    "input_type": "ingest"
  }
}

@davidkyle davidkyle added >bug :ml Machine learning auto-backport Automatically create backport pull requests when merged v9.0.0 v8.18.0 v8.17.2 v8.19.0 v9.1.0 labels Jan 31, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @davidkyle, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Jan 31, 2025
model.getServiceSettings().getNumThreads(),
model.getServiceSettings().modelId(),
model.getServiceSettings().getAdaptiveAllocationsSettings(),
model.getServiceSettings().getDeploymentId(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix. The rest of the changes are removing constructors or reducing the visibility of the ctors so that it is not possible to make this mistake

Copy link
Member

@dan-rubinstein dan-rubinstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidkyle davidkyle enabled auto-merge (squash) January 31, 2025 16:00
@davidkyle davidkyle merged commit d3a8a4b into elastic:main Jan 31, 2025
17 checks passed
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Jan 31, 2025
…eployment id (elastic#121428)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Jan 31, 2025
…eployment id (elastic#121428)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Jan 31, 2025
…eployment id (elastic#121428)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0
8.18
8.17 Commit could not be cherrypicked due to conflicts
8.x

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 121428

elasticsearchmachine pushed a commit that referenced this pull request Jan 31, 2025
…eployment id (#121428) (#121440)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Feb 3, 2025
…eployment id (elastic#121428) (elastic#121440)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserInternalServiceSettings.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/MultilingualE5SmallInternalServiceSettings.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 3, 2025
…eployment id (#121428) (#121440) (#121514)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserInternalServiceSettings.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/MultilingualE5SmallInternalServiceSettings.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 10, 2025
…eployment id (#121428) (#121438)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
elasticsearchmachine pushed a commit that referenced this pull request Feb 10, 2025
…eployment id (#121428) (#121439)

Fixes a bug where the deployment Id was lost creating the text embedding
model configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending >bug :ml Machine learning Team:ML Meta label for the ML team v8.17.2 v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants